package  com.syqc.sensor.oil

import com.syqc.comlib.utils.CacheMMKV


/**
 *@author  hfjs
 *@time   2025/2/28 16:12
 *@desc  油耗详情设置
 */
object OilModel {
    private var isDate: Boolean
    private var isTeam: Boolean
    private var isUp  : Boolean
    private var isDown: Boolean
    private var isLeak: Boolean
    private var isSpeed   : Boolean
    private var isRun     : Boolean
    private var isMile    : Boolean
    private var isTotal100: Boolean
    private var isRun100  : Boolean

    init{
        isDate= CacheMMKV.decodeBoolean("isDate",true)
        isTeam=CacheMMKV.decodeBoolean("isTeam",false)
        isUp  =CacheMMKV.decodeBoolean("isUp",true)
        isDown=CacheMMKV.decodeBoolean("isDown",true)
        isLeak=CacheMMKV.decodeBoolean("isLeak",false)
        isSpeed   =CacheMMKV.decodeBoolean("isSpeed",false)
        isRun     =CacheMMKV.decodeBoolean("isRun",false)
        isMile    =CacheMMKV.decodeBoolean("isMile",true)
        isTotal100=CacheMMKV.decodeBoolean("isTotal100",false)
        isRun100  =CacheMMKV.decodeBoolean("isRun100",false)
    }

    fun getDate(): Boolean = isDate

    fun setDate(isDate: Boolean) {
        this.isDate=isDate
        CacheMMKV.encode("isDate",isDate)
    }

    fun getTeam(): Boolean = isTeam

    fun setTeam(isTeam: Boolean) {
        this.isTeam=isTeam
        CacheMMKV.encode("isTeam",isTeam)
    }

    fun getUp(): Boolean = isUp

    fun setUp(isUp: Boolean) {
        this.isUp=isUp
        CacheMMKV.encode("isUp",isUp)
    }

    fun getDown(): Boolean = isDown

    fun setDown(isDown: Boolean) {
        this.isDown=isDown
        CacheMMKV.encode("isDown",isDown)
    }

    fun getLeak(): Boolean = isLeak

    fun setLeak(isLeak: Boolean) {
        this.isLeak=isLeak
        CacheMMKV.encode("isLeak",isLeak)
    }

    fun getSpeed(): Boolean = isSpeed

    fun setSpeed(isSpeed: Boolean) {
        this.isSpeed=isSpeed
        CacheMMKV.encode("isSpeed",isSpeed)
    }

    fun getRun(): Boolean = isRun

    fun setRun(isRun: Boolean) {
        this.isRun=isRun
        CacheMMKV.encode("isRun",isRun)
    }

    fun getMile(): Boolean = isMile

    fun setMile(isMile: Boolean) {
        this.isMile=isMile
        CacheMMKV.encode("isMile",isMile)
    }

    fun getTotal100(): Boolean = isTotal100

    fun setTotal100(isTotal100: Boolean) {
        this.isTotal100=isTotal100
        CacheMMKV.encode("isTotal100",isTotal100)
    }

    fun getRun100(): Boolean = isRun100

    fun setRun100(isRun100: Boolean) {
        this.isRun100=isRun100
        CacheMMKV.encode("isRun100",isRun100)
    }
}